<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/', function () use ($router) {
    return $router->app->version();
});
// $router->get('/getTest', 'Backstage\User\UserManageController@pwd'); //查看密码
$router->group(['prefix' => 'api'], function () use ($router) {
    $router->group(['prefix' => 'Admin'], function () use ($router) {
        //--权限
        $router->get('/verifytoken', 'Backstage\Auth\VerifytokenController@token'); //验证token
        //注册
        // $router->post('/register', 'Backstage\Auth\RegisterController@register');
        $router->post('/Auth/login', 'Backstage\Auth\LoginController@login'); //登录
        $router->get('/Auth/getpubKey', 'Backstage\Auth\LoginController@getpubKey'); //公私钥
        //----管理员模块
        $router->get('/UserManage/usermanage', 'Backstage\User\UserManageController@usermanage'); //用户列表
        $router->post('/UserManage/adduser', 'Backstage\User\UserManageController@adduser'); //新增用户
        $router->post('/UserManage/verifycode', 'Backstage\User\UserManageController@verifycode'); //查看密码
        $router->post('/UserManage/changeManageInfo', 'Backstage\User\UserManageController@changeManageInfo'); //修改用户信息
        $router->get('/UserManage/deluser', 'Backstage\User\UserManageController@deluser'); //删除用户
        //----管理员模块

        //----用户模块
        $router->get('/User/getUserList', 'Backstage\User\UserController@getUserList'); //用户列表
        //----用户模块

        // ----资源模块
        $router->get('/Resources/getResources', 'Backstage\Resources\ResourcesController@getResources'); //获取资源列表
        $router->get('/Resources/getResourcesDetail', 'Backstage\Resources\ResourcesController@getResourcesDetail'); //获取资源详情
        $router->post('/Resources/addResources', 'Backstage\Resources\ResourcesController@addResources'); //新增资源
        $router->post('/Resources/upResources', 'Backstage\Resources\ResourcesController@upResources'); //修改资源
        $router->get('/Resources/delResources', 'Backstage\Resources\ResourcesController@delResources'); //删除资源
        //资源分类
        $router->get('/Resources/getResourcescate', 'Backstage\Resources\ResourcesCateController@getResourcesCate'); //获取资源分类
        $router->get('/Resources/getAllResourcesCate', 'Backstage\Resources\ResourcesCateController@getAllResourcesCate'); //获取全部资源分类
        $router->get('/Resources/getParentResourcesCate', 'Backstage\Resources\ResourcesCateController@getParentResourcesCate'); //获取资源父级分类
        $router->post('/Resources/addResourcescate', 'Backstage\Resources\ResourcesCateController@addResourcescate'); //新增资源分类
        $router->post('/Resources/editResourcescate', 'Backstage\Resources\ResourcesCateController@editResourcescate'); //修改资源分类
        $router->get('/Resources/delResourcescate', 'Backstage\Resources\ResourcesCateController@delResourcescate'); //删除资源分类
        // --资源分类
        
        // ----资源模块


        // ----文章模块
        $router->get('/Article/articlemanage', 'Backstage\Article\ArticleController@articlemanage'); //文章列表
        $router->get('/Article/getArticleDetail', 'Backstage\Article\ArticleController@getArticleDetail'); //文章详情
        $router->post('/Article/addarticle', 'Backstage\Article\ArticleController@addarticle'); //新增文章
        $router->post('/Article/updatearticle', 'Backstage\Article\ArticleController@updatearticle'); //修改文章
        $router->get('/Article/delarticle', 'Backstage\Article\ArticleController@delarticle'); //删除文章
        $router->post('/Article/Searcharticle', 'Backstage\Article\ArticleController@Searcharticle'); //文章搜索
        $router->get('/Article/fenci', 'Backstage\Article\ArticleController@fenci'); //文章分词

        //文章分类
        $router->get('/Article/getArticleCate', 'Backstage\Article\ArticleCateController@getArticleCate'); //获取文章分类
        $router->get('Article/getAllArticleCate', 'Backstage\Article\ArticleCateController@getAllArticleCate'); //获取全部文章分类
        $router->get('/Article/getParentArticleCate', 'Backstage\Article\ArticleCateController@getParentArticleCate'); //获取文章父级分类
        $router->post('/Article/addarticlecate', 'Backstage\Article\ArticleCateController@addarticlecate'); //新增文章分类
        $router->post('/Article/editarticlecate', 'Backstage\Article\ArticleCateController@editarticlecate'); //修改文章分类
        $router->get('/Article/delarticlecate', 'Backstage\Article\ArticleCateController@delarticlecate'); //删除文章分类
        $router->get('/Article/getArticleStatus','Backstage\Article\ArticleCateController@getArticleStatus');//获取文章分类状态
        $router->post('/Article/setArticleStatus','Backstage\Article\ArticleCateController@setArticleStatus');//设置文章分类状态
        //文章标签
        $router->get('/ArticleTag/getTagList', 'Backstage\Article\ArticleTagController@getTagList'); //获取文章标签列表
        $router->post('/ArticleTag/addTag', 'Backstage\Article\ArticleTagController@addTag'); //新增文章标签
        $router->post('/ArticleTag/updateTag', 'Backstage\Article\ArticleTagController@updateTag'); //修改文章标签
        $router->get('/ArticleTag/delTag', 'Backstage\Article\ArticleTagController@delTag'); //删除文章标签
        //文章评论
        $router->get('/ArticleComment/getCommentList', 'Backstage\Article\ArticleCommentController@getCommentList'); //获取文章评论列表
        $router->get('/ArticleComment/delArticleComment', 'Backstage\Article\ArticleCommentController@delArticleComment');//删除文章评论
        $router->get('/ArticleComment/setCommentStatus', 'Backstage\Article\ArticleCommentController@setCommentStatus');//设置评论审核

        // ----文章模块

        // ----文件管理
        $router->post('/file/editfileupload', 'Backstage\File\FileController@editfileupload'); //编辑器上传图片
        $router->post('/file/uploadfile', 'Backstage\File\FileController@uploadfile'); //上传单个图片
        $router->get('/file/getFileList', 'Backstage\File\FileController@getFileList'); //获取文件列表
        $router->get('/file/DelFile', 'Backstage\File\FileController@DelFile');//删除文件
        // ----文件管理



        // ---广告管理
        $router->get('/Ads/getads', 'Backstage\Ads\AdsController@getads'); //获取广告列表
        $router->get('/Ads/getadsdetail', 'Backstage\Ads\AdsController@getadsdetail'); //获取广告详情
        $router->post('/Ads/addads', 'Backstage\Ads\AdsController@addads'); //新增广告
        $router->post('/Ads/editads', 'Backstage\Ads\AdsController@editads'); //修改广告
        $router->get('/Ads/delads', 'Backstage\Ads\AdsController@delads'); //删除广告
        // ---广告管理

        // ---留言管理
        $router->get('/Message/getMessage', 'Backstage\Message\MessageController@getMessage'); //获取留言
        // ---留言管理

        // ---友链管理
        $router->get('/Link/getLink', 'Backstage\Link\LinkController@getLink'); //获取友链列表
        $router->get('/Link/getLinkdetail', 'Backstage\Link\LinkController@getLinkdetail'); //获取友链详情
        $router->post('/Link/addLink', 'Backstage\Link\LinkController@addLink'); //新增友链
        $router->post('/Link/editLink', 'Backstage\Link\LinkController@editLink'); //修改友链
        $router->get('/Link/delLink', 'Backstage\Link\LinkController@delLink'); //删除友链
 
        // ---友链管理

        // ---站点设置
        $router->get('/Setting/getSettingInfo', 'Backstage\Setting\SettingController@getSettingInfo'); //获取站点设置
        $router->post('/Setting/saveSettingInfo', 'Backstage\Setting\SettingController@saveSettingInfo'); //保存站点设置
        $router->get('/Setting/getSetting', 'Backstage\Setting\SettingController@getSetting'); //获取其他设置
        $router->post('/Setting/updateSetting', 'Backstage\Setting\SettingController@updateSetting'); //保存其他设置
        $router->get('/Setting/getoverview', 'Backstage\Setting\SettingController@getoverview'); //获取概览数据
        $router->get('/Setting/getHomeCateStatus', 'Backstage\Setting\SettingController@getHomeCateStatus'); //获取首页分类状态
        $router->post('/Setting/setHomeCateStatus', 'Backstage\Setting\SettingController@setHomeCateStatus');  //设置首页分类状态
        // ---站点设置
    });
    $router->group(['prefix' => 'Reception'], function () use ($router) {
        //设置
        $router->get('/Setting/getSetting', 'Reception\Setting\SettingController@getSetting'); //获取站点信息
        $router->get('/Setting/getHomeCateStatus','Reception\Setting\SettingController@getHomeCateStatus');  //设置首页分类状态
        $router->get('/WxSetting/getWxUnlimited','Reception\Setting\WxSettingController@getWxUnlimited');//获取分享小程序码
        
        //设置
        //权限模块
        
        $router->get('/Auth/getWxToken', 'Reception\Auth\VerifyController@getWxToken'); //微信小程序获取token

        // $router->get('/Auth/getpubKey', 'Reception\Auth\VerifyController@getpubKey'); //生成密钥
        // $router->get('/Auth/createTmpToken', 'Reception\Auth\VerifyController@createTmpToken'); //获取临时凭证
        // $router->get('/Auth/getToken', 'Reception\Auth\VerifyController@getToken'); //获取正式凭证
        // $router->get('/Auth/createUniqueId', 'Reception\Auth\VerifyController@createUniqueId'); //生产唯一ID
        //权限模块

        //用户模块
        //  $router->post('/Users/wxUserLogin', 'Reception\Users\UserController@wxUserLogin'); //微信用户登录
        $router->post('/User/wxUserLogin', 'Reception\User\UserController@wxUserLogin'); //微信用户登录
        $router->get('/User/getUserInfo', 'Reception\User\UserController@getUserInfo');// 获取用户信息

        //用户模块
        //文章模块
        $router->get('/Article/getArticleList', 'Reception\Article\ArticleController@getArticleList'); //获取文章列表
        $router->get('/Article/getArticleDetail', 'Reception\Article\ArticleController@getArticleDetail'); //获取文章详情
        $router->post('/Article/searchArticle', 'Reception\Article\ArticleController@searchArticle'); //搜索文章
        
        $router->get('/Article/getCommentList', 'Reception\Article\ArticleCommentController@getCommentList'); //获取文章评论列表
        $router->get('/Article/getAllComment', 'Reception\Article\ArticleCommentController@getAllComment'); //获取所有文章评论列表
        $router->get('/Article/getUserComment', 'Reception\Article\ArticleCommentController@getUserComment'); //获取个人文章评论列表
        $router->post('/Article/inComment', 'Reception\Article\ArticleCommentController@inComment'); //文章评论


        $router->get('/Article/getArticleCateList', 'Reception\Article\ArticleCateController@getArticleCateList'); //获取文章分类列表
        $router->get('/Article/getArticleCate', 'Reception\Article\ArticleCateController@getArticleCate');//获取文章分类（筛选完二级）
        $router->get('/Article/getArticleCateStatus', 'Reception\Article\ArticleCateController@getArticleCateStatus');//文章分类状态
        $router->get('/Article/ArticlePraise', 'Reception\Article\ArticleController@ArticlePraise'); //文章点赞
        $router->get('/Article/getArticlePraise', 'Reception\Article\ArticleController@getArticlePraise'); //获取文章点赞列表
        $router->get('/Article/getUserArticlePraise', 'Reception\Article\ArticleController@getUserArticlePraise'); //获取文章点赞列表
        
        $router->get('/Article/Contribution', 'Reception\Article\ArticleController@Contribution');//用户投稿

        //文章模块

        //广告模块
        $router->get('/Ads/getAdsList', 'Reception\Ads\AdsController@getAdsList'); //获取文章分类列表
        $router->get('/Ads/getWxAds', 'Reception\Setting\SettingController@getWxAds');//获取微信小程序广告
        $router->get('/Ads/getQQAds', 'Reception\Setting\SettingController@getQQAds');//获取QQ小程序广告


        //广告模块

        //资源模块
        $router->get('/Resources/getResources', 'Reception\Resources\ResourcesController@getResources'); //获取文章分类列表

        $router->get('/Resources/getResourcesCateList', 'Reception\Resources\ResourcesCateController@getResourcesCateList'); //获取文章分类列表
        $router->get('/Resources/getResourcesCate', 'Reception\Resources\ResourcesCateController@getresourcesCate');//获取文章分类（筛选完二级）

        //资源模块

        //友链模块
        $router->get('/Link/getLinkList', 'Reception\Link\LinkController@getLinkList'); //获取友链列表
        //友链模块

        //留言
        $router->post('/Message/setMessage', 'Reception\Message\MessageController@setMessage');
    });
});
